package com.hashmap1;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

class Customer{
	private int custId;
	private String custName;
	private long custPhone;
	
	public Customer(int custId, String custName, long custPhone) {
		this.custId = custId;
		this.custName = custName;
		this.custPhone = custPhone;
	}
	public int getCustId() {
		return custId;
	}
	public void setCustId(int custId) {
		this.custId = custId;
	}
	public String getCustName() {
		return custName;
	}
	public void setCustName(String custName) {
		this.custName = custName;
	}
	public long getCustPhone() {
		return custPhone;
	}
	public void setCustPhone(long custPhone) {
		this.custPhone = custPhone;
	}
	@Override
	public String toString() {
		return "custId : " + custId + ", custName : " + custName
				+ ", custPhone : " + custPhone ;
	}
	
}
public class HashMapTest2 {
public static void main(String[] args) {
	Map<Integer, Customer> custMap=new HashMap<Integer, Customer>();
	Customer cust1=new Customer(101, "deepak", 9999);
	Customer cust2=new Customer(102, "avinash", 95566);
	Customer cust3=new Customer(103, "amit y", 8989);
	Customer cust4=new Customer(104, "raman", 5566);
	Customer cust5=new Customer(104, "sashi", 21233);
	custMap.put(cust1.getCustId(), cust1);
	custMap.put(cust2.getCustId(), cust2);
	custMap.put(cust3.getCustId(), cust3);
	custMap.put(cust4.getCustId(), cust4);
	custMap.put(cust5.getCustId(), cust5);
	Set<Integer> keyset=custMap.keySet();
	for(int key:keyset){
		System.out.println(custMap.get(key));
	}
}
}
